package homework.day01;

import java.io.File;
import java.io.IOException;
import java.util.Scanner;

public class Test01 {
    public static void main(String[] args) throws IOException {
        while (true) {
            Scanner scanner = new Scanner(System.in);
            System.out.println("请输入一个文件名");
            String str = scanner.next();
            File file = new File("./" + str);
            if (file.exists()) {
                System.out.println("用户更换");
            } else {
                file.createNewFile();
                System.out.println("该文件已创建");
                break;
            }
        }
    }
}
